home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Commodore Disk User Volume 4 #11
/
Commodore_Disk_User_Vol.4_11_1991_-.d64
/
bud review
(
.txt
)
< prev
next >
Wrap
Commodore BASIC
|
2022-10-26
|
10KB
|
318 lines
100 goto380
110 open2,8,2,"0:budget data 2,s,r"
120 forty=1to192
130 input#2,y$(ty)
140 input#2,y(ty)
150 nextty
160 forty=1to192
170 input#2,h$(ty)
180 input#2,h(ty)
190 nextty
200 input#2,gt$
210 forty=1to12
220 input#2,ym$(ty)
230 input#2,ym(ty)
240 nextty
250 forty=1to12
260 input#2,hm$(ty)
270 input#2,hm(ty)
280 nextty
290 forty=1to16
300 input#2,ys$(ty)
310 input#2,ys(ty)
320 nextty
330 forty=1to16
340 input#2,hs$(ty)
350 input#2,hs(ty)
360 nextty:close2
370 return
380 ifam$=mid$(mt$(1),2,3)andam=0then400
390 gosub110:goto520
400 forp=1to16:ys$(p)="0000":nextp
410 forp=1to12:ym$(p)="0000":nextp
420 forer=1to(12*16):ify$(er)="000"theny$(er)="---":nexter
430 forty=1to16
440 sr$(ty)=ss(ty):sr$(ty)=ss$(ty)
450 ss$(ty)=su(ty):ss$(ty)=su$(ty)
460 su$(ty)=st(ty):su$(ty)=st$(ty)
470 nextty:forty=1to12
480 ba(ty)=bb(ty):ba$(ty)=bb$(ty)
490 bb(ty)=bc(ty):bb$(ty)=bc$(ty)
500 bc(ty)=mt(ty):bc$(ty)=mt$(ty)
510 nextty:am$="+"
520 la$="":lb$=" ":lc$=" ":ld$=" ":le$=" "
530 lf$="[163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163][163]":lk$=""
540 forty=1to16:st$(ty)=ys$(ty):nextty
550 forty=1to12:mt$(ty)=ym$(ty):nextty
560 iffr=1thenlo=1:load"budget calc",8,1
570 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
580 print"[164][164][164][164]"
590 print"review subjects.................... f1 [146]"
600 print"[164][164][164][164]"
610 print"review months...................... f3 [146]"
620 print"[164][164][164][164]"
630 print"review totals graphically.......... f5 [146]"
640 print"[164][164][164][164]"
650 print"review profit or loss.............. f7 [146]"
660 print"[164][164][164][164][164][164][164][164][164][164][164]";
670 print"return to the spreadsheet.... space bar [146]"
680 print"what is your option ?"
690 getqu$:ifqu$=""then690
700 ifqu$="[133]"orqu$="[134]"orqu$="[135]"orqu$="[136]"orqu$=" "then720
710 goto690
720 print"[145] please wait"
730 ifqu$="[133]"then790
740 ifqu$="[134]"then1190
750 ifqu$="[135]"then1520
760 ifqu$="[136]"then2810
770 ifqu$=" "thenlo=1:load"budget calc",8,1
780 goto690
790 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
800 print"";cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
810 print""
820 prints$(1);la$;ba$(1);lc$;bb$(1);lc$;bc$(1);lc$;ys$(1):print
830 prints$(2);la$;ba$(2);lc$;bb$(2);lc$;bc$(2);lc$;ys$(2):print
840 prints$(3);la$;ba$(3);lc$;bb$(3);lc$;bc$(3);lc$;ys$(3):print
850 prints$(4);la$;ba$(4);lc$;bb$(4);lc$;bc$(4);lc$;ys$(4):print
860 prints$(5);la$;ba$(5);lc$;bb$(5);lc$;bc$(5);lc$;ys$(5):print
870 prints$(6);la$;ba$(6);lc$;bb$(6);lc$;bc$(6);lc$;ys$(6):print
880 prints$(7);la$;ba$(7);lc$;bb$(7);lc$;bc$(7);lc$;ys$(7):print
890 prints$(8);la$;ba$(8);lc$;bb$(8);lc$;bc$(8);lc$;ys$(8):print
900 print" use joystick to view other subjects"
910 print""
920 fo=16:sd=notpeek(56320)and15:fo=peek(56320)and16
930 if(sdand1)then920
940 if(sdand2)then990
950 if(sdand4)then920
960 if(sdand8)then920
970 iffo=0then570
980 sd=0:goto920
990 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
1000 print"";cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
1010 print""
1020 prints$(9);la$;ba$(9);lc$;bb$(9);lc$;bc$(9);lc$;ys$(9):print
1030 prints$(10);la$;ba$(10);lc$;bb$(10);lc$;bc$(10);lc$;ys$(10):print
1040 prints$(11);la$;ba$(11);lc$;bb$(11);lc$;bc$(11);lc$;ys$(11):print
1050 prints$(12);la$;ba$(12);lc$;bb$(12);lc$;bc$(12);lc$;ys$(12):print
1060 prints$(13);la$;ba$(13);lc$;bb$(13);lc$;bc$(13);lc$;ys$(13):print
1070 prints$(14);la$;ba$(14);lc$;bb$(14);lc$;bc$(14);lc$;ys$(14):print
1080 prints$(15);la$;ba$(15);lc$;bb$(15);lc$;bc$(15);lc$;ys$(15):print
1090 prints$(16);la$;ba$(16);lc$;bb$(16);lc$;bc$(16);lc$;ys$(16):print
1100 print" use joystick to view other subjects"
1110 print""
1120 f=16:sd=notpeek(56320)and15:fo=peek(56320)and16
1130 if(sdand1)then790
1140 if(sdand2)then1120
1150 if(sdand4)then1120
1160 if(sdand8)then1120
1170 iffo=0then570
1180 sd=0:goto1120
1190 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
1200 print"";cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
1210 print""
1220 printm$(1);"";la$;sr$(1);lc$;ss$(1);lc$;su$(1);lc$;ym$(1)
1230 print"";m$(2);"";la$;sr$(2);lc$;ss$(2);lc$;su$(2);lc$;ym$(2)
1240 print"";m$(3);"";la$;sr$(3);lc$;ss$(3);lc$;su$(3);lc$;ym$(3)
1250 print"";m$(4);"";la$;sr$(4);lc$;ss$(4);lc$;su$(4);lc$;ym$(4)
1260 print"";m$(5);"";la$;sr$(5);lc$;ss$(5);lc$;su$(5);lc$;ym$(5)
1270 print"";m$(6);"";la$;sr$(6);lc$;ss$(6);lc$;su$(6);lc$;ym$(6)
1280 print" use joystick to view following months":forty=1to100:gettu$:nextty
1290 fo=16:sd=notpeek(56320)and15:fo=peek(56320)and16
1300 if(sdand1)then1290
1310 if(sdand2)then1360
1320 if(sdand4)then1290
1330 if(sdand8)then1290
1340 iffo=0then570
1350 sd=0:goto1290
1360 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
1370 print"";cm;lb$;cm+1;lb$;cm+2;lb$;cm+3:print""
1380 print"";m$(7);"";la$;sr$(7);lc$;ss$(7);lc$;su$(7);lc$;ym$(7)
1390 print"";m$(8);"";la$;sr$(8);lc$;ss$(8);lc$;su$(8);lc$;ym$(8)
1400 print"";m$(9);"";la$;sr$(9);lc$;ss$(9);lc$;su$(9);lc$;ym$(9)
1410 print"";m$(10);"";la$;sr$(10);lc$;ss$(10);lc$;su$(10);lc$;ym$(10)
1420 print"";m$(12);"";la$;sr$(12);lc$;ss$(12);lc$;su$(12);lc$;ym$(12)
1430 print" use joystick to view following months"
1440 print"[145][145][145][145][145][145][145]";m$(11);"";la$;sr$(11);lc$;ss$(11);lc$;su$(11);lc$;ym$(11)
1450 fo=16:sd=notpeek(56320)and15:fo=peek(56320)and16
1460 if(sdand1)then1190
1470 if(sdand2)then1450
1480 if(sdand4)then1450
1490 if(sdand8)then1450
1500 iffo=0then570
1510 sd=0:goto1450
1520 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
1530 ifgt>4000then2160
1540 ifgt(1)>4000then2160
1550 ifgt(2)>4000then2160
1560 ifgt(3)>4000then2160
1570 print"";la$;cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
1580 print"4000 [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164] "
1590 print"[167] [221] [221] [221] [165]"
1600 print"[167] [221] [221] [221] [165]"
1610 print"[167] [221] [221] [221] [165]"
1620 print"3000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
1630 print"[167] [221] [221] [221] [165]"
1640 print"[167] [221] [221] [221] [165]"
1650 print"[167] [221] [221] [221] [165]"
1660 print"2000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
1670 print"[167] [221] [221] [221] [165]"
1680 print"[167] [221] [221] [221] [165]"
1690 print"[167] [221] [221] [221] [165]"
1700 print"1000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
1710 print"[167] [221] [221] [221] [165]"
1720 print"[167] [221] [221] [221] [165]"
1730 print"[167] [221] [221] [221] [165]"
1740 print" 0[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
1750 gi=1:gh=7:gosub1790
1760 gi=2:gh=14:gosub1790
1770 gi=3:gh=21:gosub1790
1780 gt$=str$(gt):le$=left$(gt$,2):gt$(4)=gt$:gi=4:gh=28:gosub1830:goto2040
1790 gt(4)=gt
1800 fora=1to4
1810 gt$(a)=str$(gt(a))
1820 nexta
1830 le$=left$(gt$(gi),2)
1840 print""tab(gh);
1850 le=val(le$):ifle=0then1900
1860 forde=1tole
1870 print" [145][157][157][157][157] [145][157][157][157][157]";
1880 print" [145][157][157][157][157] [145][157][157][157][157]";
1890 nextde
1900 le$=mid$(gt$(gi),3,1)
1910 le=val(le$):ifle=0then1990
1920 ifle=1thenprint"[146][185][185][185][185]":goto1990
1930 ifle=2thenprint"[183][183][183][183]":goto1990
1940 ifle=3thenprint" [145][157][157][157][157][146][175][175][175][175][146]":goto1990
1950 ifle=4thenprint" [145][157][157][157][157][183][183][183][183][146]":goto1990
1960 ifle=5thenprint" [145][157][157][157][157] [146]":goto1990
1970 ifle=6thenprint" [145][157][157][157][157] [146][145][157][157][157][157][146][185][185][185][185]":goto1990
1980 goto2000
1990 return
2000 ifle=7thenprint" [145][157][157][157][157] [146][145][157][157][157][157][183][183][183][183]":goto1990
2010 ifle=8thenprint" [145][157][157][157][157] [146][145][157][157][157][157] [146][145][157][157][157][157][146][185][185][185][185]":goto1990
2020 ifle=9thenprint" [145][157][157][157][157] [146][145][157][157][157][157] [146][145][157][157][157][157][183][183][183][183]":goto1990
2030 goto1990
2040 print"[146]:- grand totals[146]"
2050 print"";
2060 print""gt(1)
2070 print"";
2080 print"";gt(2)
2090 print"";
2100 print"";gt(3)
2110 print"";
2120 print"";gt
2130 print" "
2140 print"":gt$=mid$(gt$,2):gt$=""+gt$
2150 goto2740
2160 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
2170 print"";la$;cm;lb$;cm+1;lb$;cm+2;lb$;cm+3
2180 print"9999 [164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164][164] "
2190 print"[167] [221] [221] [221] [165]"
2200 print"[167] [221] [221] [221] [165]"
2210 print"[167] [221] [221] [221] [165]"
2220 print"8000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
2230 print"[167] [221] [221] [221] [165]"
2240 print"[167] [221] [221] [221] [165]"
2250 print"[167] [221] [221] [221] [165]"
2260 print"6000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
2270 print"[167] [221] [221] [221] [165]"
2280 print"[167] [221] [221] [221] [165]"
2290 print"[167] [221] [221] [221] [165]"
2300 print"4000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
2310 print"[167] [221] [221] [221] [165]"
2320 print"[167] [221] [221] [221] [165]"
2330 print"[167] [221] [221] [221] [165]"
2340 print"2000[167][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][221][164][164][164][164][164][164][165]"
2350 print" [167] [221] [221][160] [221] [165]"
2360 print" [167] [221] [221] [221] [165]"
2370 print" [167] [221] [221][160] [221] [165]"
2380 print" 0[167] [221] [221] [221] [165]"
2390 gi=1:gh=7:gosub2420:gi=2:gh=14:gosub2420:gi=3:gh=21:gosub2420
2400 gt$=str$(gt):le$=left$(gt$,2)
2410 gt$(4)=gt$:gi=4:gh=28:gosub2430:goto2630
2420 gt(4)=gt:fora=1to4:gt$(a)=str$(gt(a)):nexta
2430 le$=left$(gt$(gi),2)
2440 print""tab(gh);
2450 le=val(le$):ifle=0then2490
2460 forde=1tole
2470 print" [146][145][157][157][157][157] [146][145][157][157][157][157]";
2480 nextde
2490 le$=mid$(gt$(gi),3,1)
2500 le=val(le$):ifle=0then2580
2510 ifle=1thenprint"[185][185][185][185]":goto2580
2520 ifle=2thenprint"[162][162][162][162]":goto2580
2530 ifle=3thenprint"[184][184][184][184][146]":goto2580
2540 ifle=4thenprint"[183][183][183][183][146]":goto2580
2550 ifle=5thenprint"[163][163][163][163][146]":goto2580
2560 ifle=6thenprint" [146]":goto2580
2570 goto2590
2580 return
2590 ifle=7thenprint" [145][157][157][157][157][146][164][164][164][164]":goto2580
2600 ifle=8thenprint" [145][157][157][157][157][146][175][175][175][175]":goto2580
2610 ifle=9thenprint" [145][157][157][157][157][146][185][185][185][185]":goto2580
2620 goto2580
2630 print"[146]:- grand totals[146]"
2640 print"";
2650 print""gt(1)
2660 print"";
2670 print"";gt(2)
2680 print"";
2690 print"";gt(3)
2700 print"";
2710 print"";gt
2720 print" "
2730 print"":gt$=mid$(gt$,2):gt$=""+gt$
2740 fo=16:sd=notpeek(56320)and15:fo=peek(56320)and16
2750 if(sdand1)then2740
2760 if(sdand2)then2740
2770 if(sdand4)then2740
2780 if(sdand8)then2740
2790 iffo=0then570
2800 sd=0:goto2740
2810 print"[147]review figures[157][157][157][157][157][157][157][157][157][157][157][157][157][157][163][163][163][163][163][163] [163][163][163][163][163][163][163]"
2820 forui=1to12:a$=left$(m$(ui),2)
2830 printtab(11+ui);a$;:nextui:print" ";
2840 foraf=1to16:prints$(af);"[207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][208] [207][208]":nextaf
2850 printtab(12)"[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183] [183][183]"
2860 printtab(12);"[207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][183][207][208] [207][208]"
2870 printtab(12)"[183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183][183] [183][183]"
2880 print" [146][158]=loss (actual is more than estimated)"
2890 print" [146][158]=profit(actual is less than estimated)"
2900 forw=1to192
2910 v(w)=h(w)-y(w):ifv(w)>0thenv(w)=1:goto2940
2920 ifv(w)<0thenv(w)=-1:goto2940
2930 ifv(w)=0thenv(w)=0:goto2940
2940 nextw:sc=10:mp=0:print"";:goto3030
2950 forer=1to12
2960 mp=mp+1:ifv(mp)=1then2990
2970 ifv(mp)=-1then3000
2980 ifv(mp)=0then3010
2990 printtab(sc+(er*2))" [146][158]";:goto3020
3000 printtab(sc+(er*2))" [146][158]";:goto3020
3010 printtab(sc+(er*2))"[146][158]";
3020 nexter:return
3030 forzz=1to16:print"":gosub2950:nextzz
3040 mp=0:print""
3050 mp=mp+1:ifmp=17then3120
3060 io=hs(mp)-ys(mp):ifio>0thenio=1:goto3110
3070 ifio<0thenio=-1:goto3100
3080 ifio=0thenio=0:goto3090
3090 printtab(37)"[146]":goto3050
3100 printtab(37)" [146]":goto3050
3110 printtab(37)" [146]":goto3050
3120 mp=0:print""
3130 mp=mp+1:ifmp=13then3200
3140 io=hm(mp)-ym(mp):ifio>0thenio=1:goto3190
3150 ifio<0thenio=-1:goto3180
3160 ifio=0thenio=0:goto3170
3170 printtab(10+(mp*2))"[146]";:goto3130
3180 printtab(10+(mp*2))" [146]";:goto3130
3190 printtab(10+(mp*2))" [146]";:goto3130
3200 print""
3210 ifgh=gtthenprinttab(37)"[146]":goto3240
3220 ifgh>gtthenprinttab(37)" [146]":goto3240
3230 ifgh<gtthenprinttab(37)" [146]":goto3240
3240 print"[158]";:fo=peek(56320)and16
3250 iffo=0then570
3260 goto3240